JBoss.orgCommunity Documentation
The Signaling Connection Control Part (SCCP) is defined in ITU-T Recommendations Q.711-Q.716. SCCP sits on top of Message Transfer Part 3 (MTP3) in the SS7 protocol stack. The SCCP provides additional network layer functions to provide transfer of noncircuit-related (NCR) signaling information, application management procedures and alternative and more flexible methods of routing.
Routing rules are configured using the Command Line Interface as explained Section 5.4, “SCCP Management”
The org.mobicents.protocols.ss7.sccp.SccpStack
is responsible for taking the
config file and turning it into org.mobicents.protocols.ss7.sccp.Router
.
All the sccp messages sent by SCCP User Part are routed as per the rule configured in Router
The term SCCP User Part refers to the applications that use SCCP's services.
The SCCP User Part gets handle to SccpStack
by doing JNDI look-up as
explained in Section 6.3, “Access Point”
SccpStack
exposes org.mobicents.protocols.ss7.sccp.SccpProvider
that interacts directly with SccpStack. This interface defines the methods that will be used by SCCP User Part to send
org.mobicents.protocols.ss7.sccp.message.SccpMessage
and register
org.mobicents.protocols.ss7.sccp.SccpListener
's to listen for incoming SCCP messages.
SCCP User Part registers SccpListener for specific local org.mobicents.protocols.ss7.sccp.parameter.SccpAddress
.
For every incoming SccpMessage, if the called party address matches with this local SccpAddress, the corresponding SccpListner is called.
SccpProvider also exposes org.mobicents.protocols.ss7.sccp.message.MessageFactory
and
org.mobicents.protocols.ss7.sccp.parameter.ParameterFactory
to create new concrete SccpMessage viz.,
org.mobicents.protocols.ss7.sccp.message.UnitData
or
org.mobicents.protocols.ss7.sccp.message.XUnitData
passing the corresponding parameters created by leveraging
ParameterFactory.
The UML class diagram looks like
SS7 Service
provides user with access point to SCCP
protocol/stack.
To get handle to SccpStack
do the JNDI look-up passing the
JNDI name configured in SS7 service as explained in Section 3.4.5, “Configuring SS7Service”
private static SccpProvider getSccpProvider() throws NamingException {
// no arg is ok, if we run in JBoss
InitialContext ctx = new InitialContext();
try {
String providerJndiName = "/mobicents/ss7/sccp";
return ((SccpStack) ctx.lookup(providerJndiName)).getSccpProvider();
} finally {
ctx.close();
}
}
Below is SCCP User Part example listening for incoming SCCP message and sending back new message
public class Test implements SccpListener {
private SccpProvider sccpProvider;
private SccpAddress localAddress;
private static SccpProvider getSccpProvider() throws NamingException {
// no arg is ok, if we run in JBoss
InitialContext ctx = new InitialContext();
try {
String providerJndiName = "/mobicents/ss7/sccp";
return ((SccpStack) ctx.lookup(providerJndiName)).getSccpProvider();
} finally {
ctx.close();
}
}
public void start() throws Excetpion {
this.sccpProvider = getSccpProvider();
int translationType = 0;
int subSystemNumber = 0;
GlobalTitle gt = GlobalTitle.getInstance(translationType,
NumberingPlan.ISDN_MOBILE, NatureOfAddress.NATIONAL, "1234");
localAddress = new SccpAddress(gt, 0);
this.sccpProvider.registerSccpListener(localAddress, this);
}
public void stop() {
this.sccpProvider.deregisterSccpListener(localAddress);
}
public void onMessage(SccpMessage message) {
if (message.getType() == MessageType.UDT) {
throw new IlleagalArgumentException("Dont like UDT");
} else if (message.getType() == MessageType.XUDT) {
XUnitData xudt = (XUnitData) message;
localAddress = ((XUnitData) message).getCalledPartyAddress();
SccpAddress remoteAddress = ((XUnitData) message)
.getCallingPartyAddress();
// now decode content
byte[] data = xudt.getData();
// some data encoded in
CallRequest cr = new CallRequest(data);
byte[] answerData;
if (cr.getCallee().equals(this.localAddress)) {
EstablihsCallAnswer eca = new EstablihsCallAnswer(cr);
answerData = eca.encode();
} else {
TearDownCallAnswer tdca = new TearDownCallAnswer(cr);
answerData = tdca.encode();
}
HopCounter hc = this.sccpProvider.getParameterFactory()
.createHopCounter(5);
XUnitData sccpAnswer = this.sccpProvider
.getMessageFactory()
.createXUnitData(hc, xudt.getProtocolClass(),
message.getCallingPartyAddress(), this.localAddress);
this.sccpProvider.send(sccpAnswer);
}
}
}